Repository navigation
feat(triage): chat-channel messages, set authoring, context-aware remediation - #18
Merged
Merged
Conversation
…ediation - POST /api/triage lets trainers add triage sets (validated: id pattern, 4-40 items, must mix pretexts and legitimate messages, every pretext needs a principle and explanation); audited. - Triage Inbox renders WhatsApp/SMS items as a phone chat and offers a set picker when more than one set exists. - Remediation assignments carry reason_key/reason_params so the reason is translated in the UI instead of stored as English text. - Remediation prefers content sharing context tags with the failed exercise and never re-assigns the exercise that was just failed; retests follow the same rule. - Scenario debrief keeps line breaks; removed duplicate untranslated "Try another scenario" button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #17.
What
POST /api/triage(trainer): author triage sets. Validation: id^[a-z0-9-]+$, language en/id, 4–40 items, must contain both pretexts and legitimate messages, each pretext needsprinciple+explanation. Duplicate id → 409. Audited.whatsapp/smsitems render as a phone-style chat pane; set picker appears when more than one set exists.reason_key+reason_params; My Assignments renders them viaremediation.*keys (EN/ID).indonesia,satuan,military) and excludes the exercise that was just failed; retests do the same. Titles no longer get aRemediation:prefix.docs/api.md: triage, readiness and demo endpoints.Why
Chat-based pretexts are a primary lure channel but cannot ethically be sent to personal phones; the lab measures them as a triage channel scored with d′ (false flags on legitimate messages are penalised). Remediation for a localized failure should stay in the same context instead of falling back to a generic English scenario.
Testing
pytest: 219 passed (new tests for set authoring/validation, translated reasons, context preference + failed-exercise exclusion)ruff check/ruff formatcleanCI=true craco buildOK🤖 Generated with Claude Code